﻿using Common.Enums;
using Common.Interfaces;

namespace Common.Entities
{
    public class ServerSpecific : IServerSpecific
    {
        private string _businessExceptionDescription;
        private string _businessWarningDescription;
        private ResponseStatus _responseStatus;

        public void AddServerSpecificData(string businessExceptionDescription, string businessWarningDescription)
        {
            Empty();

            if (businessExceptionDescription != string.Empty)
            {
                _businessExceptionDescription = businessExceptionDescription;
                _responseStatus = ResponseStatus.Error;
            }

            if(businessWarningDescription != string.Empty)
            {
                _businessWarningDescription = businessWarningDescription;
                _responseStatus = ResponseStatus.Warning;
            }

        }

        public void Empty()
        {
            _businessExceptionDescription = string.Empty;
            _businessWarningDescription = string.Empty;
            _responseStatus = ResponseStatus.Ok;
        }

        public string BusinessWarningDescription
        {
            get { return _businessWarningDescription; }
        }

        public string BusinessExceptionDescription
        {
            get { return _businessExceptionDescription; }
        }

        public ResponseStatus ResponseStatus
        {
            get { return _responseStatus; }
        }
    }
}
